package com.heima.kafka.listener;

import com.alibaba.fastjson.JSON;
import com.heima.kafka.pojo.User;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * @author brianxia
 * @version 1.0
 * @date 2022-09-18 16:27
 */
@Component
public class HelloListener106 {

    @KafkaListener(topics = {"itheima-004","itheima-001"})
    public void test(String msg){
        User user = JSON.parseObject(msg, User.class);
        System.out.println(user);
    }
}
